
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JComponent;
import javax.swing.JFrame;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Riso
 */
public class Zakladna extends JComponent{

    JFrame f;
    int farba;
    public Zakladna(JFrame j,int x,int y,int farba){
        this.f= j;
        setBounds(x, y, 101, 101);
        this.farba = farba;
    }

    @Override
    public void paint(Graphics g) {
        if(farba==1)
        g.setColor(Color.GREEN);
        else g.setColor(Color.BLUE);
        g.fillRect(0, 0, 100, 100);
        if(farba==1)
        g.setColor(Color.BLUE);
        else g.setColor(Color.BLACK);
        g.drawRect(0, 0, 100, 100);
    }
    
    
    
}
